Skip to content

Conversation

@DeagleGross
Copy link
Contributor

@DeagleGross DeagleGross commented Nov 14, 2025

Motivation and Context

Today there are a couple of disrepancies between registrations and DevUI behavior:

  1. If AIAgent is not registered via AddAIAgent(), but added to the ASP.NET Core DI directly, then it will not be displayed in the DevUI at all.
  2. The same as №1 goes for workflow
  3. If workflow is registered, but not added as AIAgent (for example via AddAsAIAgent()), then it will be visible in DevUI, but it will simply not work.
  4. Workflows and AIAgents registered as non-keyed services will not be visible at all.

The reason is that DevUI <-> AF communication works via OpenAI Responses, and OpenAI Responses implementation resolves the request model through AIAgent by the name from keyed services.

The PR actually simplifies the public API (removed AgentCatalog and WorkflowCatalog).

Contribution Checklist

  • The code builds clean without any errors or warnings
  • The PR follows the Contribution Guidelines
  • All unit tests pass, and I have added new tests where possible
  • Is this a breaking change? If yes, add "[BREAKING]" prefix to the title of the PR.

Fixes #2149
Related #2084

Copilot AI review requested due to automatic review settings November 14, 2025 15:57
@markwallace-microsoft markwallace-microsoft added documentation Improvements or additions to documentation .NET labels Nov 14, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR simplifies the agent and workflow registration API by removing the AgentCatalog and WorkflowCatalog abstractions in favor of direct keyed service resolution. It introduces a new AddDevUI() extension method that enables DevUI integration by automatically converting registered workflows to agents when needed.

Key Changes:

  • Removed AgentCatalog and WorkflowCatalog public APIs and their internal registry implementations
  • Added AddDevUI() extension methods for IServiceCollection and IHostApplicationBuilder
  • Updated entity discovery to enumerate keyed services directly using KeyedService.AnyKey

Reviewed Changes

Copilot reviewed 18 out of 18 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
dotnet/src/Microsoft.Agents.AI.DevUI/ServiceCollectionsExtensions.cs New extension method to register DevUI services with keyed service factory for workflow-to-agent conversion
dotnet/src/Microsoft.Agents.AI.DevUI/HostApplicationBuilderExtensions.cs New extension method to add DevUI services to IHostApplicationBuilder
dotnet/src/Microsoft.Agents.AI.DevUI/EntitiesApiExtensions.cs Updated entity discovery to use direct keyed service enumeration instead of catalog pattern
dotnet/src/Microsoft.Agents.AI.DevUI/README.md Updated documentation to show new AddDevUI() registration
dotnet/src/Microsoft.Agents.AI.Hosting/HostApplicationBuilderWorkflowExtensions.cs Removed workflow registry registration logic
dotnet/src/Microsoft.Agents.AI.Hosting/AgentHostingServiceCollectionExtensions.cs Removed agent registry registration logic
dotnet/src/Microsoft.Agents.AI.Hosting/Local/LocalAgentCatalog.cs Removed internal catalog implementation
dotnet/src/Microsoft.Agents.AI.Hosting/Local/LocalAgentRegistry.cs Removed internal registry
dotnet/src/Microsoft.Agents.AI.Hosting/Local/LocalWorkflowCatalog.cs Removed internal catalog implementation
dotnet/src/Microsoft.Agents.AI.Hosting/Local/LocalWorkflowRegistry.cs Removed internal registry
dotnet/src/Microsoft.Agents.AI.Hosting/AgentCatalog.cs Removed public catalog abstraction
dotnet/src/Microsoft.Agents.AI.Hosting.OpenAI/Responses/HostedAgentResponseExecutor.cs Improved error message for agent not found scenarios
dotnet/samples/AgentWebChat/AgentWebChat.AgentHost/Program.cs Added DevUI registration and additional test agent/workflow registrations
dotnet/samples/AgentWebChat/AgentWebChat.AgentHost/ActorFrameworkWebApplicationExtensions.cs Updated agent discovery to use keyed services directly
dotnet/samples/AgentWebChat/AgentWebChat.AppHost/Program.cs Added DevUI endpoint configuration
dotnet/tests/Microsoft.Agents.AI.Hosting.A2A.UnitTests/Properties/launchSettings.json Added launch settings for the test project

Copy link
Member

@BrennanConroy BrennanConroy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Non-keyed agents/workflows aren't handled

Copy link
Contributor

@javiercn javiercn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, but I would review the unit tests. I feel they are essentially testing DI behaviors.

@DeagleGross DeagleGross added this pull request to the merge queue Nov 18, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Nov 18, 2025
@DeagleGross DeagleGross added this pull request to the merge queue Nov 18, 2025
Merged via the queue into main with commit 1da9107 Nov 18, 2025
15 checks passed
@DeagleGross DeagleGross deleted the dmkorolev/devui-fixes branch November 18, 2025 16:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation .NET

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

.NET: Agent and Workflow discovery should use DI more natively

6 participants